<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增任务')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-fantasyTask-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">任务名称：</label>
				<div class="col-sm-8">
					<input id="taskName" name="taskName" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">任务描述：</label>
				<div class="col-sm-8">
					<input id="taskDesc" name="taskDesc" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">任务类型：</label>
				<div class="col-sm-8">
					<select class="form-control" name="taskType" th:with="type=${@dict.getType('fantasy_task_type')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">任务周期：</label>
				<div class="col-sm-8">
					<select class="form-control" name="taskPeriod" th:with="type=${@dict.getType('fantasy_task_period')}">
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">任务发起人：</label>
				<div class="col-sm-8">
					<select id="taskFrom" name="taskFrom" class="form-control">
						<option value="-1">无</option>
						<option th:each="fantasyNpc:${fantasyNpcList}" th:alt-title="${fantasyNpc.npcDesc}" th:value="${fantasyNpc.npcId}" th:text="${fantasyNpc.npcName}" value="1">
							aaa
						</option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">任务接收人：</label>
				<div class="col-sm-8">
					<select id="taskTo" name="taskTo" class="form-control">
						<option value="-1">无</option>
						<option th:each="fantasyNpc:${fantasyNpcList}" th:alt-title="${fantasyNpc.npcDesc}" th:value="${fantasyNpc.npcId}" th:text="${fantasyNpc.npcName}" value="1">
							aaa
						</option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">任务道具：</label>
				<div class="col-sm-8">
					<select id="taskItem" name="taskItem" class="form-control">
						<option value="-1">无</option>
						<option th:each="fantasyItemType:${fantasyItemTypeList}" th:alt-title="${fantasyItemType.itemDesc}"
								th:value="${fantasyItemType.id}" th:text="${fantasyItemType.name}" value="1">
							aaa
						</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">关键字：</label>
				<div class="col-sm-8">
					<input id="keyWord" name="keyWord" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">随机任务：</label>
				<div class="col-sm-8">
					<select name="taskIsRand" class="form-control m-b" th:with="type=${@dict.getType('fantasy_yes_no')}" required>
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">起始任务：</label>
				<div class="col-sm-8">
					<select name="taskIsStart" class="form-control m-b" th:with="type=${@dict.getType('fantasy_yes_no')}" required>
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">任务链：</label>
				<div class="col-sm-8">
					<select name="taskIsChain" class="form-control m-b" th:with="type=${@dict.getType('fantasy_yes_no')}" required>
						<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">开始任务id：</label>
				<div class="col-sm-8">
					<select id="startTask" name="startTask" class="form-control">
						<option value="-1">无</option>
						<option th:each="fantasyTaskNode:${fantasyTaskList}" th:alt-title="${fantasyTaskNode.taskDesc}"
								th:value="${fantasyTaskNode.taskId}" th:text="${fantasyTaskNode.taskName}" value="1">
							aaa
						</option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">前置任务id：</label>
				<div class="col-sm-8">
					<select id="taskPredecessorId" name="taskPredecessorId" class="form-control">
						<option value="-1">无</option>
						<option th:each="fantasyTaskNode:${fantasyTaskList}" th:alt-title="${fantasyTaskNode.taskDesc}"
								th:value="${fantasyTaskNode.taskId}" th:text="${fantasyTaskNode.taskName}" value="1">
							aaa
						</option>
					</select>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">后续任务id：</label>
				<div class="col-sm-8">
					<select id="taskSuccessorId" name="taskSuccessorId" class="form-control">
						<option value="-1">无</option>
						<option th:each="fantasyTaskNode:${fantasyTaskList}" th:alt-title="${fantasyTaskNode.taskDesc}"
								th:value="${fantasyTaskNode.taskId}" th:text="${fantasyTaskNode.taskName}" value="1">
							aaa
						</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">任务回复：</label>
				<div class="col-sm-8">
					<input id="taskResp" name="taskResp" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">备注信息：</label>
				<div class="col-sm-8">
					<input id="remark" name="remark" class="form-control" type="text">
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "fantasy/fantasyTask"
		$("#form-fantasyTask-add").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-fantasyTask-add').serialize());
	        }
	    }
	</script>
</body>
</html>
